package simple;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.framework.ProxyFactory;

/**
 * @Auther: luobiao
 * @Date: 2020/4/28 22:50
 * @Description:
 */
public class TestMain {
    public static void main(String[] args) {
        ProxyFactory proxyFactory = new ProxyFactory(new HelloImpl());
        proxyFactory.addAdvice((MethodBeforeAdvice)(method,args1,target)->{
            System.out.println("方法前置通知执行中...；method="+method+"；arg="+args1[0]+"；target="+target);
        });
        Hello hello=(Hello)proxyFactory.getProxy();
        hello.say("hello world");
    }
}
